ABC259 C - XX to XXX
提出
code: python
s = input()
t = input()
for i in range(1, len(s)):
print(sarray)
if len(sarray) > 0 and sarray-1 == si and si == si-1: sarray.pop(-1)
else:
for i in range(1, len(t)):
print(tarray)
if len(tarray) > 0 and tarray-1 == ti and ti == ti-1: tarray.pop(-1)
else:
# print(sarray)
print(tarray)
print("".join(sarray) == "".join(tarray))
解答
code: python
s = input()
t = input()
def rle(s):
cnt = 1
res = []
for i in range(1, len(s)):
cnt = 0
cnt += 1
return res
sres = rle(s)
tres = rle(t)
if (len(sres) != len(tres)):
print("No")
exit()
ans = True
for i in range(len(sres)):
ans = False
if not (sresi1 == tresi1 or sresi1 < tresi1 and sresi1 >= 2): # 2つ以上なかったら間に入れられない ans = False
print("Yes") if ans else print("No")
メモ
提出
TLE RE WA
code: python
s = list(input())
t = list(input())
# abbaac
# abbbbaaac
ends = []
while len(t) > 0 and len(s) > 0:
nows = s.pop(0)
nowt = t.pop(0)
if nows == nowt:
ends.append(nows)
continue
else:
if ends-1 == nowt and ends-2 == nowt: t.pop(0)
ends.append(nows)
continue
else:
print("No")
exit()
print("Yes")